package com.zzf.concurrent.example.design.pattern.immutable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author GaoFeng2017
 * @date 2019/9/7 16:31
 */
public final class ImmutableObjectStandard {

    private final String name;
    private final String desc;
    private final List<Integer> numbers;

    public ImmutableObjectStandard(String name, String desc, List<Integer> numbers) {
        this.name = name;
        this.desc = desc;
        this.numbers = new ArrayList<>(numbers);
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public List<Integer> getNumbers() {
        return Collections.unmodifiableList(numbers);
    }
}
